﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using YArchitech.Controls;
using YArchitech.DataModel;
using YArchitech.LIB;
using YArchitech.LIB.YJKControls;
using YArchitech.Plumbing.Properties;

namespace YArchitech.Plumbing
{
	public partial class FormLaySprinklerHeadByArea : System.Windows.Forms.Form
	{
		public event FormLaySprinklerHeadByArea.mydelegate myevent;

		public int LayType
		{
			get
			{
				return this.layType;
			}
			set
			{
				this.layType = value;
			}
		}

		public FormLaySprinklerHeadByArea()
		{
			this.InitializeComponent();
			base.Location = new Point(100, 100);
			//base.Icon = Resource.YArchitechIcon;
			this.strchecked = this.userSettingS.GetRadioChecked();
			string a = this.strchecked;
			if (a == "1")
			{
				this.rtnYanXian.Checked = true;
				return;
			}
			if (a == "2")
			{
				this.rbtJuXing.Checked = true;
				return;
			}
			if (a == "3")
			{
				this.rbtLingXing.Checked = true;
				return;
			}
			if (!(a == "4"))
			{
				return;
			}
			this.rbtJuZhong.Checked = true;
		}

		private void rtnYanXian_CheckedChanged(object sender, EventArgs e)
		{
			if (this.rtnYanXian.Checked)
			{
				base.Width = 380;
				this.layType = 1;
				this.panelYanXian.Visible = true;
				this.panelJuXing.Visible = false;
				this.panelJuZhong.Visible = false;
				this.LaySettingInitYanXian();
				this.strchecked = "1";
			}
		}

		private void rbtJuXing_CheckedChanged(object sender, EventArgs e)
		{
			if (this.rbtJuXing.Checked)
			{
				this.layType = 3;
				this.pictureBox3.Image = YArchitech.Plumbing.Properties.Resources.喷头矩形布置;
				this.panelYanXian.Visible = false;
				this.panelJuXing.Visible = true;
				this.panelJuZhong.Visible = false;
				this.LaySettingInitJuXing();
				this.strchecked = "2";
				this.InitCmbDanger();
			}
		}

		private void rbtJuZhong_CheckedChanged(object sender, EventArgs e)
		{
			if (this.rbtJuZhong.Checked)
			{
				base.Width = 380;
				this.layType = 4;
				this.panelYanXian.Visible = false;
				this.panelJuXing.Visible = false;
				this.panelJuZhong.Visible = true;
				this.LaySettingInitJuZhong();
				this.strchecked = "4";
			}
		}

		private void rbtLingXing_CheckedChanged(object sender, EventArgs e)
		{
			if (this.rbtLingXing.Checked)
			{
				this.layType = 5;
				this.pictureBox3.Image = YArchitech.Plumbing.Properties.Resources.菱形布置示意图;
				this.panelYanXian.Visible = false;
				this.panelJuXing.Visible = true;
				this.panelJuZhong.Visible = false;
				this.LaySettingInitLingXing();
				this.InitCmbDanger();
				this.strchecked = "3";
			}
		}

		private void btnCancle_Click(object sender, EventArgs e)
		{
			base.DialogResult = DialogResult.Cancel;
		}

		private void btnOk_Click(object sender, EventArgs e)
		{
			if (this.myevent != null)
			{
				this.myevent(this);
			}
			switch (this.layType)
			{
			case 1:
				this.GetFormDadaForYanXian();
				break;
			case 3:
				this.GetFormDataForJuXing();
				break;
			case 4:
				this.GetFormDataForJuZhong();
				break;
			case 5:
				this.GetFormDataForLingXing();
				break;
			}
			this.userSettingS.WriteRadioChecked(this.strchecked);
			base.DialogResult = DialogResult.OK;
		}

		public void GetFormDadaForYanXian()
		{
			string limitStr = "1";
			if (this.rdoLimitNumber.Checked)
			{
				if (this.hytbCount.Text.Trim() == "" || this.hytbRatio.Text.Trim() == "")
				{
					MessageBox.Show("所有参数均不能为空", "盈建科提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					return;
				}
				this.layLineParameter.LimitFlag = 1;
				this.layLineParameter.Count = Convert.ToInt32(this.hytbCount.Text.Trim());
				this.layLineParameter.Ratio = Convert.ToDouble(this.hytbRatio.Text.Trim());
				limitStr = "1";
			}
			else if (this.rdoLimitDistance.Checked)
			{
				if (this.hytbDistance.Text.Trim() == "" || this.hytbDistanceSide.Text.Trim() == "")
				{
					MessageBox.Show("所有参数均不能为空", "盈建科提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					return;
				}
				this.layLineParameter.LimitFlag = 2;
				this.layLineParameter.Distance = Convert.ToDouble(this.hytbDistance.Text.Trim());
				this.layLineParameter.DistanceSide = Convert.ToDouble(this.hytbDistanceSide.Text.Trim());
				limitStr = "2";
			}
			this.LaySettingWriteYanXian(limitStr);
		}

		private void RdoNumberGroup(bool check)
		{
			this.hytbCount.Enabled = check;
			this.hytbRatio.Enabled = check;
		}

		private void RdoDistanceGroup(bool check)
		{
			this.hytbDistance.Enabled = check;
			this.hytbDistanceSide.Enabled = check;
		}

		private void rdoLimitNumber_CheckedChanged(object sender, EventArgs e)
		{
			if (this.rdoLimitNumber.Checked)
			{
				this.rdoLimitDistance.Checked = false;
				this.RdoNumberGroup(true);
				return;
			}
			this.RdoNumberGroup(false);
		}

		private void rdoLimitDistance_CheckedChanged(object sender, EventArgs e)
		{
			if (this.rdoLimitDistance.Checked)
			{
				this.rdoLimitNumber.Checked = false;
				this.RdoDistanceGroup(true);
				return;
			}
			this.RdoDistanceGroup(false);
		}

		private void LaySettingWriteYanXian(string limitStr)
		{
			this.userSettingS.WriteLaySprinklersLine(this.layLineParameter);
		}

		private void LaySettingInitYanXian()
		{
			this.layLineParameter = this.userSettingS.GetLaySprinklersLine();
			this.hytbCount.Text = this.layLineParameter.Count.ToString();
			this.hytbRatio.Text = this.layLineParameter.Ratio.ToString();
			this.hytbDistance.Text = this.layLineParameter.Distance.ToString();
			this.hytbDistanceSide.Text = this.layLineParameter.DistanceSide.ToString();
			string a = this.layLineParameter.LimitFlag.ToString();
			string a2 = this.layLineParameter.OneLine.ToString();
			if (a == "2")
			{
				this.rdoLimitDistance.Checked = true;
				this.rdoLimitNumber.Checked = false;
			}
			else
			{
				this.rdoLimitNumber.Checked = true;
				this.rdoLimitDistance.Checked = false;
			}
			if (a2 == "1")
			{
				this.rboneline.Checked = true;
				return;
			}
			if (a2 == "2")
			{
				this.rbtwopoint.Checked = true;
			}
		}

		private void hytbRatio_TextChanged(object sender, EventArgs e)
		{
			if (double.Parse(this.hytbRatio.Text.Trim()) > 1.0)
			{
				YJKMessageBox.Show("输入的最大值不能超过1");
				this.hytbRatio.Text = "0";
				base.Focus();
			}
		}

		private void rboneline_CheckedChanged(object sender, EventArgs e)
		{
			this.layLineParameter.OneLine = 1;
		}

		private void rbtwopoint_CheckedChanged(object sender, EventArgs e)
		{
			this.layLineParameter.OneLine = 2;
		}

		public void GetFormDataForJuXing()
		{
			string limitStr = "1";
			if (this.rdoLimitNumber2.Checked)
			{
				if (!(this.hytbRowCount.Text.Trim() != "") || !(this.hytbColCount.Text.Trim() != "") || !(this.hytbRatio2.Text.Trim() != ""))
				{
					YJKMessageBox.Show("所有参数均不能为空");
					return;
				}
				this.layAreaParameter.LimitFlag = 1;
				this.layAreaParameter.RowCount = Convert.ToInt32(this.hytbRowCount.Text.Trim());
				this.layAreaParameter.ColCount = Convert.ToInt32(this.hytbColCount.Text.Trim());
				this.layAreaParameter.Ratio = Convert.ToDouble(this.hytbRatio2.Text.Trim());
				limitStr = "1";
			}
			else if (this.rdoLimitDistance2.Checked)
			{
				if (!this.IsInputNorm())
				{
					return;
				}
				this.layAreaParameter.LimitFlag = 2;
				this.layAreaParameter.RowDistance = Convert.ToDouble(this.hytbRowDistance.Text.Trim());
				this.layAreaParameter.ColDistance = Convert.ToDouble(this.hytbColDistance.Text.Trim());
				this.layAreaParameter.RowDistanceSide = Convert.ToDouble(this.hytbRowDistanceSide.Text.Trim());
				this.layAreaParameter.ColDistanceSide = Convert.ToDouble(this.hytbColDistanceSide.Text.Trim());
				this.layAreaParameter.LessDistance = double.Parse(this.hytbSmallDistance.Text.Trim());
				this.layAreaParameter.Danger = this.cmbDanger.Text;
				limitStr = "2";
			}
			if (this.layType == 3)
			{
				this.LaySettingWriteJuXing(limitStr);
				return;
			}
			if (this.layType == 5)
			{
				this.LaySettingWriteLingXing(limitStr);
			}
		}

		private bool IsInputNorm()
		{
			bool result = true;
			if (this.IsTextBoxEmpty(this.hytbColDistance))
			{
				result = false;
			}
			else if (this.IsTextBoxEmpty(this.hytbRowDistance))
			{
				result = false;
			}
			else if (this.IsTextBoxEmpty(this.hytbRowDistanceSide))
			{
				result = false;
			}
			else if (this.IsTextBoxEmpty(this.hytbColDistanceSide))
			{
				result = false;
			}
			else if (this.IsTextBoxEmpty(this.hytbSmallDistance))
			{
				result = false;
			}
			else if (!this.IsTextBoxNumber(this.hytbColDistance))
			{
				result = false;
			}
			else if (!this.IsTextBoxNumber(this.hytbRowDistance))
			{
				result = false;
			}
			else if (!this.IsTextBoxNumber(this.hytbRowDistanceSide))
			{
				result = false;
			}
			else if (!this.IsTextBoxNumber(this.hytbColDistanceSide))
			{
				result = false;
			}
			else if (!this.IsTextBoxNumber(this.hytbSmallDistance))
			{
				result = false;
			}
			return result;
		}

		private bool IsTextBoxEmpty(TextBox tb)
		{
			bool result = false;
			if (tb.Text.Trim() == "")
			{
				result = true;
				YJKMessageBox.Information("所有参数均不能为空");
				tb.Focus();
			}
			return result;
		}

		private bool IsTextBoxNumber(TextBox tb)
		{
			bool flag = true;
			try
			{
				if (Convert.ToDouble(tb.Text.Trim()) <= 0.0)
				{
					YJKMessageBox.Information("所有参数均为正数");
					flag = false;
				}
			}
			catch (Exception)
			{
				YJKMessageBox.Information("所有参数均为数字");
				flag = false;
			}
			if (!flag)
			{
				tb.Text = "";
				tb.Focus();
			}
			return flag;
		}

		private void LaySettingInitJuXing()
		{
			this.cmbDanger.Text = this.layAreaParameter.Danger;
			this.layAreaParameter = this.userSettingS.GetLaySprinklersArea();
			this.hytbRowCount.Text = this.layAreaParameter.RowCount.ToString();
			this.hytbColCount.Text = this.layAreaParameter.ColCount.ToString();
			this.hytbRatio2.Text = this.layAreaParameter.Ratio.ToString();
			this.hytbRowDistance.Text = this.layAreaParameter.RowDistance.ToString();
			this.hytbColDistance.Text = this.layAreaParameter.ColDistance.ToString();
			this.hytbRowDistanceSide.Text = this.layAreaParameter.RowDistanceSide.ToString();
			this.hytbColDistanceSide.Text = this.layAreaParameter.ColDistanceSide.ToString();
			if (this.layAreaParameter.LimitFlag.ToString() == "2")
			{
				this.rdoLimitDistance2.Checked = true;
				this.rdoLimitNumber2.Checked = false;
				return;
			}
			this.rdoLimitNumber2.Checked = true;
			this.rdoLimitDistance2.Checked = false;
		}

		private void LaySettingWriteJuXing(string limitStr)
		{
			this.userSettingS.WriteLaySprinklersArea(this.layAreaParameter);
		}

		private void RdoNumberGroupJuXing(bool check)
		{
			this.hytbRowCount.Enabled = check;
			this.hytbColCount.Enabled = check;
			this.hytbRatio.Enabled = check;
		}

		private void RdoDistanceGroupJuXing(bool check)
		{
			this.hytbRowDistance.Enabled = check;
			this.hytbColDistance.Enabled = check;
			this.hytbRowDistanceSide.Enabled = check;
			this.hytbColDistanceSide.Enabled = check;
			this.cmbDanger.Enabled = check;
			this.hytbSmallDistance.Enabled = check;
			if (check)
			{
				base.Width = 583;
				return;
			}
			base.Width = 380;
		}

		private void rdoLimitNumber2_CheckedChanged(object sender, EventArgs e)
		{
			if (this.rdoLimitNumber2.Checked)
			{
				this.rdoLimitDistance2.Checked = false;
				this.RdoNumberGroupJuXing(true);
				return;
			}
			this.RdoNumberGroupJuXing(false);
		}

		private void rdoLimitDistance2_CheckedChanged(object sender, EventArgs e)
		{
			if (this.rdoLimitDistance2.Checked)
			{
				this.rdoLimitNumber2.Checked = false;
				this.RdoDistanceGroupJuXing(true);
				return;
			}
			this.RdoDistanceGroupJuXing(false);
		}

		private void InitCmbDanger()
		{
			this.cmbDanger.Items.Clear();
			this.cmbDanger.DisplayMember = "Name";
			this.cmbDanger.ValueMember = "MoreDistanceRow";
			this.cmbDanger.Items.Add(new DangerItem("轻危险级", 4400.0, 4400.0, 2400.0, 2200.0, 2200.0, 3100.0));
			this.cmbDanger.Items.Add(new DangerItem("中危险级I", 3600.0, 3600.0, 2400.0, 1800.0, 1800.0, 2500.0));
			this.cmbDanger.Items.Add(new DangerItem("中危险级II", 3400.0, 3400.0, 2400.0, 1700.0, 1700.0, 2400.0));
			this.cmbDanger.Items.Add(new DangerItem("严重危险级I", 3000.0, 3000.0, 2400.0, 1500.0, 1500.0, 2100.0));
			this.cmbDanger.SelectedItem = this.cmbDanger.Items[0];
		}

		private void InitCmbDangerLingXing()
		{
			this.cmbDanger.Items.Clear();
			this.cmbDanger.DisplayMember = "Name";
			this.cmbDanger.ValueMember = "MoreDistanceRow";
			this.cmbDanger.Items.Add(new DangerItem("轻危险级", 4400.0, 4400.0, 2400.0, 3000.0, 3000.0, 3100.0));
			this.cmbDanger.Items.Add(new DangerItem("中危险级I", 3600.0, 3600.0, 2400.0, 2200.0, 2200.0, 2500.0));
			this.cmbDanger.Items.Add(new DangerItem("中危险级II", 3400.0, 3400.0, 2400.0, 2100.0, 2100.0, 2400.0));
			this.cmbDanger.Items.Add(new DangerItem("严重危险级I", 3000.0, 3000.0, 2400.0, 1800.0, 1800.0, 2100.0));
			this.cmbDanger.SelectedItem = this.cmbDanger.Items[0];
		}

		private void cmbDanger_SelectedIndexChanged(object sender, EventArgs e)
		{
			DangerItem dangerItem = this.cmbDanger.SelectedItem as DangerItem;
			this.hytbRowDistance.Text = dangerItem.MoreDistanceRow.ToString();
			this.hytbColDistance.Text = dangerItem.MoreDistanceCol.ToString();
			this.hytbSmallDistance.Text = dangerItem.LessDistance.ToString();
			this.hytbRowDistanceSide.Text = dangerItem.SideDistanceRow.ToString();
			this.hytbColDistanceSide.Text = dangerItem.SideDistanceCol.ToString();
		}

		private void hytbRowDistance_TextChanged(object sender, EventArgs e)
		{
			this.ChangeForeColor(this.hytbRowDistance, 10.0, 10000.0);
		}

		private void hytbColDistance_TextChanged(object sender, EventArgs e)
		{
			this.ChangeForeColor(this.hytbColDistance, 10.0, 10000.0);
		}

		private void hytbSmallDistance_TextChanged(object sender, EventArgs e)
		{
			this.ChangeForeColor(this.hytbSmallDistance, 10.0, 10000.0);
		}

		private void hytbRowDistanceSide_TextChanged(object sender, EventArgs e)
		{
			this.ChangeForeColor(this.hytbRowDistanceSide, 0.0, 10000.0);
		}

		private void hytbColDistanceSide_TextChanged(object sender, EventArgs e)
		{
			this.ChangeForeColor(this.hytbColDistanceSide, 0.0, 10000.0);
		}

		private void ChangeForeColor(TextBox tb, double min, double max)
		{
			try
			{
				if (Convert.ToDouble(tb.Text) < min || Convert.ToDouble(tb.Text) > max)
				{
					tb.ForeColor = System.Drawing.Color.Red;
				}
				else
				{
					tb.ForeColor = System.Drawing.Color.Black;
				}
			}
			catch (Exception)
			{
			}
		}

		private void hytbRowDistance_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '.' || e.KeyChar == '.')
			{
				string text = ((TextBox)sender).Text;
				for (int i = 0; i < text.Length; i++)
				{
					if (text[i] == '.')
					{
						e.Handled = true;
						return;
					}
				}
			}
			if (!StringTools.IsNumber(e.KeyChar))
			{
				e.Handled = true;
				return;
			}
			e.Handled = false;
		}

		public void GetFormDataForJuZhong()
		{
			if (this.hytbRowNum.Text.Trim() == "" || this.hytbColNum.Text.Trim() == "" || this.hytbTopDistance.Text.Trim() == "" || this.hytbBottomDistance.Text.Trim() == "" || this.hytbLeftDistance.Text.Trim() == "" || this.hytbRightDistance.Text.Trim() == "" || this.hytbRow.Text.Trim() == "" || this.hytbCol.Text.Trim() == "")
			{
				MessageBox.Show("所有参数均不能为空", "盈建科提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				return;
			}
			if (this.tabControl1.SelectedTab.Name == "tpGrid")
			{
				this.layMidParameter.Type = 1;
			}
			else if (this.tabControl1.SelectedTab.Name == "tpDistance")
			{
				this.layMidParameter.Type = 0;
			}
			this.layMidParameter.RowCount = Convert.ToInt32(this.hytbRowNum.Text.Trim());
			this.layMidParameter.ColCount = Convert.ToInt32(this.hytbColNum.Text.Trim());
			this.layMidParameter.TopDistance = Convert.ToDouble(this.hytbTopDistance.Text.Trim());
			this.layMidParameter.BottomDistance = Convert.ToDouble(this.hytbBottomDistance.Text.Trim());
			this.layMidParameter.LeftDistance = Convert.ToDouble(this.hytbLeftDistance.Text.Trim());
			this.layMidParameter.RightDistance = Convert.ToDouble(this.hytbRightDistance.Text.Trim());
			this.layMidParameter.RowDistance = double.Parse(this.hytbRow.Text.Trim());
			this.layMidParameter.ColDistance = double.Parse(this.hytbCol.Text.Trim());
			this.LaySettingWriteJuZhong();
		}

		private void LaySettingInitJuZhong()
		{
			this.layMidParameter = this.userSettingS.GetLaySprinklersMid();
			if (this.layMidParameter.Type == 1)
			{
				this.tabControl1.SelectedIndex = 1;
			}
			else
			{
				this.tabControl1.SelectedIndex = 0;
			}
			if (this.tabControl1.SelectedTab.Name == "tpGrid")
			{
				this.hytbRowNum.Text = this.layMidParameter.RowCount.ToString();
				this.hytbColNum.Text = this.layMidParameter.ColCount.ToString();
				this.hytbTopDistance.Text = this.layMidParameter.TopDistance.ToString();
				this.hytbBottomDistance.Text = this.layMidParameter.BottomDistance.ToString();
				this.hytbLeftDistance.Text = this.layMidParameter.LeftDistance.ToString();
				this.hytbRightDistance.Text = this.layMidParameter.RightDistance.ToString();
				return;
			}
			if (this.tabControl1.SelectedTab.Name == "tpDistance")
			{
				this.hytbRow.Text = this.layMidParameter.RowDistance.ToString();
				this.hytbCol.Text = this.layMidParameter.ColDistance.ToString();
			}
		}

		private void LaySettingWriteJuZhong()
		{
			if (this.tabControl1.SelectedIndex == 0)
			{
				this.layMidParameter.Type = 0;
			}
			else
			{
				this.layMidParameter.Type = 1;
			}
			this.layMidParameter.TopDistance = Convert.ToDouble(this.hytbTopDistance.Text.Trim());
			this.layMidParameter.BottomDistance = Convert.ToDouble(this.hytbBottomDistance.Text.Trim());
			this.layMidParameter.LeftDistance = Convert.ToDouble(this.hytbLeftDistance.Text.Trim());
			this.layMidParameter.RightDistance = Convert.ToDouble(this.hytbRightDistance.Text.Trim());
			this.layMidParameter.RowCount = Convert.ToInt32(this.hytbRowNum.Text.Trim());
			this.layMidParameter.ColCount = Convert.ToInt32(this.hytbColNum.Text.Trim());
			this.layMidParameter.RowDistance = double.Parse(this.hytbRow.Text.Trim());
			this.layMidParameter.ColDistance = double.Parse(this.hytbCol.Text.Trim());
			this.userSettingS.WriteLaySprinklersMid(this.layMidParameter);
		}

		private void LaySettingInitLingXing()
		{
			this.cmbDanger.Text = this.layAreaParameterlx.Danger;
			this.layAreaParameterlx = this.userSettingS.GetLaySprinklersLingXing();
			this.hytbRowCount.Text = this.layAreaParameterlx.RowCount.ToString();
			this.hytbColCount.Text = this.layAreaParameterlx.ColCount.ToString();
			this.hytbRatio2.Text = this.layAreaParameterlx.Ratio.ToString();
			this.hytbRowDistance.Text = this.layAreaParameterlx.RowDistance.ToString();
			this.hytbColDistance.Text = this.layAreaParameterlx.ColDistance.ToString();
			this.hytbRowDistanceSide.Text = this.layAreaParameterlx.RowDistanceSide.ToString();
			this.hytbColDistanceSide.Text = this.layAreaParameterlx.ColDistanceSide.ToString();
			if (this.layAreaParameterlx.LimitFlag.ToString() == "2")
			{
				this.rdoLimitDistance2.Checked = true;
				this.rdoLimitNumber2.Checked = false;
				return;
			}
			this.rdoLimitNumber2.Checked = true;
			this.rdoLimitDistance2.Checked = false;
		}

		private void LaySettingWriteLingXing(string limitStr)
		{
			this.userSettingS.WriteLaySprinklersLingXing(this.layAreaParameterlx);
		}

		public void GetFormDataForLingXing()
		{
			string limitStr = "1";
			if (this.rdoLimitNumber2.Checked)
			{
				this.layAreaParameterlx.LimitFlag = 1;
				this.layAreaParameterlx.RowCount = Convert.ToInt32(this.hytbRowCount.Text.Trim());
				this.layAreaParameterlx.ColCount = Convert.ToInt32(this.hytbColCount.Text.Trim());
				this.layAreaParameterlx.Ratio = Convert.ToDouble(this.hytbRatio2.Text.Trim());
				limitStr = "1";
			}
			else if (this.rdoLimitDistance2.Checked)
			{
				if (!this.IsInputNorm())
				{
					return;
				}
				this.layAreaParameterlx.LimitFlag = 2;
				this.layAreaParameterlx.RowDistance = Convert.ToDouble(this.hytbRowDistance.Text.Trim());
				this.layAreaParameterlx.ColDistance = Convert.ToDouble(this.hytbColDistance.Text.Trim());
				this.layAreaParameterlx.RowDistanceSide = Convert.ToDouble(this.hytbRowDistanceSide.Text.Trim());
				this.layAreaParameterlx.ColDistanceSide = Convert.ToDouble(this.hytbColDistanceSide.Text.Trim());
				this.layAreaParameterlx.LessDistance = double.Parse(this.hytbSmallDistance.Text.Trim());
				this.layAreaParameterlx.Danger = this.cmbDanger.Text;
				limitStr = "2";
			}
			if (this.layType == 3)
			{
				this.LaySettingWriteJuXing(limitStr);
				return;
			}
			if (this.layType == 5)
			{
				this.LaySettingWriteLingXing(limitStr);
			}
		}

		private int layType;

		private HVACUserSetting userSettingS = new HVACUserSetting();

		private UserSetting _userSettingS = new UserSetting();

		public LayLineParameter layLineParameter = new LayLineParameter();

		public LayAreaParameter layAreaParameter = new LayAreaParameter();

		public LayAreaParameter layAreaParameterlx = new LayAreaParameter();

		public LayMidParameter layMidParameter = new LayMidParameter();

		private string strchecked = "";

		public delegate void mydelegate(FormLaySprinklerHeadByArea dlg);
	}
}
